Here's an except from http://support.apple.com/kb/HT3553#13
How do I remove a card from the SD card slot?
As with any removable media device, allow any data transfer to SD media to complete before removing the card. When removing the card, the best way to insure the integrity of your data is to drag the icon that represents the card to the Trash, then remove the card from the slot after the icon disappears from your desktop.
If you accidentally placed the SD card inside of the optical drive slot then turning the iMac on its side and letting gravity assist you may work. Poking objects inside the optical drive may cause damage to the optical pickup assembly, so use caution.