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
Loading User Information from Channel 9
Something went wrong getting user information from Channel 9
Loading User Information from MSDN
Something went wrong getting user information from MSDN
Loading Visual Studio Achievements
Something went wrong getting the Visual Studio Achievements
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