Micromachined 3D millimeter-wave and terahertz devices