Not sure how many members know this but here it is:
Yes, there are ways to get the key other than a dealer but there is always a chance it won't work.
Also, most local dealers will charge you and arm and a leg unles you have some sort of discount.
Over the last few years I've bought 4 keys (for various BMW's) online from this dealer and they have very good pricing and easy process:
You order key on their website, submit photo of your driver licence and proof of ownership with VIN (title or registration or insurance card etc...) to their email adresss and few days later cut key comes in mail.
It also comes completely ready (no need to sync it), at least I never had to.
I just got a back up key for my newly purchased 2006 X5. It came with one good working remote key and I didn't want to spend $180 so I went with "door and ignition key" for $73 shipped.
This key opens the door mechanicaly and starts the car. It also has small light strobe (you press BMW logo). I imagine it's there so you don't scratch the paint in the dark by trying to find the lock hole.
Anyway, just wanted to share this easy process of getting a key.