When you no longer need to use a viewport with a given device, first delete any lights and materials associated with it and then remove it from the device's viewport list by calling the IDirect3DDevice3::DeleteViewport method. DeleteViewport accepts the address of an IDirect3DViewport3 interface as its only parameter. (If you're using execute buffers, you will be calling the IDirect3DDevice::DeleteViewport method, which accepts the address of an IDirect3DViewport interface.)
Deleting a viewport only removes it from a device's viewport list; it doesn't free the resources allocated for the viewport object itself. To completely get rid of a viewport, you must release it by calling its IUnknown::Release method.