How are the "medical communication" headset sockets on some airliners used?
I'm going to assume you're talking about something like this:


Photo liberally stolen from here.

As other have mentioned, these are generally connections for a standard aviation headset (headphone and microphone plugs). When plugged in you're typically connected to the cockpit (so the pilots know what's going on), and on commercial airlines you may also be patched in to a medical consulting service via radio.  

The principle behind this is similar to the early paramedic programs in the United States: Personnel with some basic training (like flight attendants) are connected to a doctor. They describe the patient's condition and symptoms, and the doctor advises on a course of treatment, which can begin immediately and hopefully give the patient a better chance of survival.

The radio patch can also be used by a doctor onboard the aircraft to consult with other physicians and to help the flight crew arrange for appropriate transport services to meet the plane when it lands.