This is in VS 2005. In your project properties, you can use the application framework, which provides some stuff like automatically saving configuration settings and XP Visual styles. I'm not sure what else it does (haven't used it), and the reason I said I disabled it was that I had seen some other posts where the same problem had been solved by disabling the app framework.
I looked under start up object again and noticed that it had my class "Startup" at the bottom of the list, which had my shared sub Main() method. I selected that as the start up item and it worked.
I still don't know exactly what was going wrong. I'm assuming by selecting "Sub Main" you're telling it to use My.MyApplication.Main(), which it then finds the other Main() that I had declared in the Startup class. Maybe by setting the startup object to Startup, the compiler doesn't generate the Main() method in My.MyApplication?
Either way, my problem is solved, but thanks for your help.