Did I use this optocoupler correctly?
It seems you have it hooked up right.

This only puts about 1 mA thru the LED, so the output current will be similarly limited.  At 1 mA you only get a current transfer ratio of 63% or 100%, depending on which variant you are actually using.  Even at 100% though, that will only cause the 100 &Omega; output resistor to rise by 100 mV.  You need a much larger output resistor for this optocoupler to make a normal digital output signal.

Also note the speed of this coupler.  It is not well specified.  The worst case is 2.8 &micro;s typical at 2 mA drive and 100 &Omega; load resistance.  You need to figure rather more than that with a larger load resistor to get a full digital output signal.  If 10 &micro;s is a significant fraction of your PWM period, then this is not good.

Overall, this is not the right optocoupler if you want a normal digital output signal or are trying to pass a PWM signal of more than a few kHz.