One commonly used approach is to read raw disk sectors one at a time and store them in a giant backup file. You can find code examples on the internet: here is one promising one on Code Project.
If the intention is to be able to restore to the same raw drive, your job is pretty much done. If you want to assign this to a new raw drive, there is additional complexity, since I suspect the boot sector will also need to be touched. I'm afraid these details are outside my realm of experience, but probably you can get more help from the microsoft.public.win32.programmer.kernel newsgroup. This is actually a bit OT for a Visual C++ newsgroup.