I had the identical issue with my MB... bought used, no code card.
At the dealer, the service manager wanted to see the car's registration and my driver's permit to prove ownership of the car/radio.
Took him about 15 seconds to look it up in their computerized data base. I suspect he looked up the VMI on the car because I saw him punch in the VIN.
I asked if he could give me a copy of the VMI and he declined. He wrote the code on the back of one of his business cards and handed to me.
Got home, punched in the code, and the radio locked up for 24 hours. Hmmm.
Contacted Becker of North America (they're in NJ). Told them the serial # of the radio and the code I'd been given. They were very helpful in telling me the code the dealer gave me was bad and that they would provide me the proper code for $30 plus proof of legal ownership (never figured out what that meant). They consider the code to be a "part" that you order from the parts department.
Anyway, off to another MB dealer... asked for the code and VMI... was told they couldn't help me because my '96 S500 was "too old and not in the data base". Then he wanted to know if I bought the car there.... when the answer was no, he simply walked away.
Back to the first dealer... he remembered me, looked it up again, and gave me a different number. That one worked.
Bottom line: They've got the code at the dealer and can give it to you instantly if you find the right guy/gal.