there should be a tine hole nearby the CD-drive, get a paperclip, straighten it, and push it to the hole, it should get the CD ou... at least in Tray-loading iMacs, maybe in slot loaders too... If not, switch the iMac on and hold the mouse button, this is common force eject removable media...