Shutdown

Or paint a blue quad on the screen and wait until to user CTRL+ALT+DEL your program.

Wait on the GPU to finish.

To wait for the GPU to complete put a fence on each of they used queues and wait for all to complete.

Release D3D objects.

Run release on objects in oposite creation order and then null all reference to them.