In addition to the social, real wasps, there are numerous solitary species. Some of them look like hornets (e.g. digger wasps and pompilids) and they can also inflict painful stings if you annoy them.
Several species of small dark ichneumon flies may be found indoors. Usually, they will not sting people, but some species can inflict non-serious stings. Identification, however, is rarely a problem because the sting is clearly felt, so the culprit is identified.
A larger species, the orange-red ophionl wasp, is an example of an ichneumon fly, which is attracted to light often strays into houses.
It can inflict a painful sting with its short stinger if you accidentally squeeze it.