The stereo must be off (fuse pulled for some) for the drive mechanism to be disengaged. Many CD decks have a pinhole somewhere on the housing (if not the front) for emergency ejecting of CD's.
If it doesn't have one, then try using tweezers to pull it out. If that doesn't work then you'll have to open up the unit. Again, you won't be able to get the CD out with the deck on.