Micromachining processes and structures in micro-optics and optoelectronics