I've had this problem for ages but it hasn't been a big enough issue for me to spend time on.
Every time I connected my Galaxy to my laptop device driver installation failed and the initializing screen would continuously refresh until I hit the home key or unplugged the USB.
I got around this issue by moving files to and from my phone using the external SD card. Painful!
Looking for a quick solution, I was very close to factory resetting my phone but I was concerned about messing up the carrier configuration.
After a quick backup of my music and pictures to the external SD card one last time, I unmounted and formatted the internal SD. Immediate response when I plugged the phone back into my laptop!
Steps to format internal SD.
SD card and phone storage
Scroll down to Internal SD card
Unmount SD card
Format SD card
PS. I'm running 32 bit Windows 7. I understand there are some issues related to 64 bit but there is an updated driver for that.