http://www.gamedev.net/topic/359794-c-direct3d-hooking-sample/

And, here is a C# project but I think you can learn the method and implement in C++

https://github.com/spazzarama/Direct3DHook

and for API hooking, you can try Detours