Use the XML-RPC API to post to your blog. Windows Live Writer and other apps are using that too. I am not very familiar with that API, so I have no good examples. But you should find enough with the keyword. There are also many plugins with sample code.