As per Richard's comment - no trivial task
you could start with something like this
http://www.ranish.com/part/[
^] and 'spawn' it off in its own process through the command line interface, but there's a 'disconnect' if you get errors that you'd have to be able to handle - that product also has source code that you may find useful - no doubt there are others like it, that you could possibly write an API for or export the useful functions as a dll
good luck