how to get a stuck bearing cup out?

I was taking apart my rear wheel, when I noticed the lack of bearing balls and appropriate parts. I wanted to remove the bearing so I can replace it with a new one, however when I was attempting to remove the last cup of the bearing, it is stuck in the hub. The local mechanic couldn't get it out and said I needed a whole new cassette and hub; I was hoping there was some nifty way I could remove it.