Direct3D is implemented through COM objects and interfaces. The Direct3D interfaces are interfaces to the DirectDraw object. DirectDraw presents programmers with a single, unified object that encapsulates both the DirectDraw and Direct3D states. The DirectDraw object is the first object your application creates (by calling DirectDrawCreate) and the last object your application releases. Since the DirectDraw object represents the display device, and the display device implements many of the most important features of Direct3D, it makes sense that the abilities of Direct3D are incorporated into DirectDraw.
The important implication of this is that the lifetime of the Direct3D driver state is the same as that of the DirectDraw object. Releasing the Direct3D interface does not destroy the Direct3D driver state. That state is not destroyed until all references to that object—whether they are DirectDraw or Direct3D references—have been released. Therefore, if you release a Direct3D interface while holding a reference to a DirectDraw driver interface, and then query the Direct3D interface again, the Direct3D state will be preserved.
The DirectDraw object contains three Direct3D interfaces: IDirect3D, IDirect3D2, and IDirect3D3. The IDirect3D and IDirect3D2 interfaces are obsolete. They are provided for backward compatibility. New applications should use the IDirect3D3 interface to create other Direct3D objects such as viewports, lights, textures, and materials. For details, see Direct3D Interfaces.