The same thing happend to me with my S320. I noticed the smell before the AC ever stopped working. I was explained that this smell (I found it to be somewhat as the smell of a brand new electrical device) is an indication of a faulty evaporator. They checked it for leaks and it was replaced.
I had it done at the dealership and it was a massive financial setback. ($2800)
I heared that on the W140 almost all of them brake within the first 5 years, but I am not sure if that goes for your model as well.
'07 ML320 CDI (398 ft lbs / 1400 RPM)
'91 928 GT Supercharged