I am asumming you started a windows application and removed the form. Class libraries cannot be started directly. Add a Module to the project and put a "sub main" in it to start the application.

Code:
Public Sub Main()

'Your code here....

end sub