Spin-Orbit Coupling for Photons and Polaritons in Microstructures