It sounds more like the issue is with creating a Windows Service. It's pretty straightforward as far as setting things up, though there are a huge number of variations depending on what you want to do and how you want to do it.
The MSDN tutorial is a good start.
The problem here is that you're asking for things that involve too much code to comfortably put in a post.