If you are not experienced in Windows programming, that could be an hard work, however you can have a look to
TightVNC[
^]: it is an open source desktop remoting application, so you can build it and browse its source code to understand how it works.
Note that it is licensed under
GNU GPL, then you cannot use it for commercial products!