Infrared studies of H II regions and OH sources