Try the following...
1. Go to "Control Panel".
2. Click on "Sound".
3. Make sure you are on the "Playback" tab.
4. Click on the device you are trying to fix to highlight it. (the headphones must be connected at this time).
5. Now right click on the device (headphones) in the list and select to set it as the "Default" device.
6. Click "Apply" and then click "OK".
Now they should be the only things playing sound when they are in, and the sound should return to the speakers when they are unplugged.
8. Then click "OK", again, on the main "Sound window".
NOTE: If they don't show in there, right click on the white background of that window and make sure both "Show disabled devices" and "Show disconnected devices" is checked.
Should you still not see the them, right click on the "Speakers", only while the headphones/speakers are plugged in, and disable them. This may resolve the issue. Be sure you test that the internal speakers work again, when you unplug the headphones/speakers.