I just bought this car from a small independent dealership last night and the did they not have the unlock code. I called the local BMW dealership and they service dept wants $$ to give out the unlock code.
As far as I know, if you prove you own the car, a small charge (sometimes it is given free) you will receive the code. If there is any cost I would ask the dealer to foot the bill as seeing you just bought the car.
Yes, try to get the dealership you bought it from to pay. A BMW dealer is the only one who will have the code, though, so you are stuck getting it from them no matter what.