for a situation where the bulb is broken in the socket i have heard a potato (potatoe Dan Quayle) works for getting the bulb out... simply cut the potato in half and press the flat side down onto the broken bulb then turn
if its completely busted and theres no glass for the potato to grip on you might need to use some pliers or something
another bit of advice would be to insure that the socket is not powered either by unplugging the lamp or flipping the breaker if it is hardwired... unless you're a sick bastard and actually like the jolting feel of getting electrocuted