This topic will require knowledge in a lot of stuff programming for one, but also code caves, and assembly. However, detours are also a nice way of going about things.
Here are a few tutorials from a fantastic source, a great group of guys as well. A lot of stuff that I have learned comes directly from these guys:
[ Probably exactly what you need ]
[ Very brief .. the code explains for itself thought ]
[ Well explained tutorial on Detours ]
I would attach the items from this site, but these guys deserve the credit. However I am able to attach a great guide that was removed from the Internet due to the site dying.