See this wiki section on deploying on the Microsoft stack for a how-to guide, including an explanation how to configure the Mendix runtime to start as a Windows service.