Not fiberoptics. These optocouplers are only like $0.95 or so.
You turn the PWM rectangle waves into on/off's of an LED that's deep inside a little Integrated Circuit. The LED beams it's light across the void of the inside of the chip (electrically isolated now!) to a thing that turns on and off whenever it gets hit with light.
http://www.mech.uwa.edu.au/NWS/How_t...to_circuit.jpg