How to supply Vcc to optocoupler?
The purpose of an optocoupler is to provide isolation. How can it
  provide isolation if Vcc is connected at both sides as shown below ?


How you might want to connect the power rails or how many isolated power rails you want to use is up to you. The optocoupler provides isolation period. If you have a circuit that doesn't benefit from this feature because the power rails and grounds are common then that is a different matter but, the opto still provides isolation in its own right and as a device.


  Also, I assume I connect the GND of VCC only at the right side, is
  that correct ?


In that non-isolated schematic GND MUST be the same net on both sides of the opto isolator. If you want isolation then use isolated (galvanically isolated) supplies. The circuit you show does not directly benefit from the isolation capabilities of the optocoupler.