Optocouplers are sometimes used in situations where a ground loop would otherwise be created between two different pieces of equipment. MIDI uses optocouplers in the transmit driver to keep the AC hum away.
Line powered medical equipment usually uses optocouplers to prevent spikes from the power supply from getting through to the patient.