Apple has posted to KB articles that might be of some interest to the iPhone crazed out there: Syncing Applications from the App Store and Troubleshooting applications purchased from the App Store (which basically says you should delete the troublesome app and re-install it).
The syncing article details how you get apps that you download from iTunes onto your iPhone (it functions in much the same way as syncing podcasts or music, you tell iTunes which apps, some or all, and there you go!). It also tells us what happens when you purchase an app directly on an iPhone and then sync to iTunes. The above message will pop up and ask if you want to transfer the apps to iTunes. If you do it will put them in the new Applications section of iTunes. Interestingly, if you sync your iPhone with an instance of iTunes that is not authorized with the same account as the one you used to buy an app, and you transfer said app to this unauthorized iTunes library the app transfers to iTunes but is deleted from the iPhone.