Coming out of the closet

'Coming out of the closet' meant we can finally come out not only to our family and friends, but also to the world. But where did it come from?