My '04 W203 C200cdi has started doing exactly the same thing. It's a quiet whine which rises in pitch with engine revs up to about 2000 rpm then sort of disappears. It stops when the climate control is turned off. It seems to be coming from the passenger footwell area, but that could be misleading.
At a guess I'd say either A/C compressor clutch, or maybe low refrigerant. A/C expansion valves can do strange things with low pressure. I don't think it's the fan because it carries on for a couple of seconds after the fan stops, then it cuts out suddenly.