Step 1) Do a little research. Google is a good start point
i.e.
http://social.technet.microsoft.com/Forums/windowsserver/en-US/901f9fd9-0278-48d0-932a-217ff06fff09/how-to-recover-corrupt-quickbooks-files[
^]
https://rebit.com/docs/quickbooks_backup_guide.pdf[
^]
Step 1b) Try to understand the inner aspects
Step 2) Start coding
Step 3) Compile and use the debug to solve little issues
Step 4) When you get a problem you don't know how to solve
but at least you tried it, then come back and ask for something concrete with a snippet of the code giving problems
Sorry if this is not the answer you were looking for. But your question is a bit too wide to be answered at the "Quick" Answers. It is better and you get faster help if you make 10 concrete questions about concrete problems, than a big question about a "how-to guide"