Sounds like you’re writing a console app but setting up the Project as a windows app. When you set up your new project and want to just use main() as the body of your executable, make sure you select Console as the type of project.
Otherwise you’ll have to have a winmain() or something as well as provide a callback function to intercept WM messages and all that jazz. Plenty of tutorials provided on the windows stuff at NeHe’s site: http://nehe.gamedev.net