OH emission from Mira variables, infrared stars and molecular clouds