Shrew is an interesting word. When used in reference to a person, nowadays it is always a woman that is meant - "a woman given to railing or scolding or other perverse or malignant behaviour", as the OED says. However, the original meaning (the first citation is for c1250) referred to a "wicked, evil-disposed or malignant man". In the 14th and 15th centuries the term shrew was applied to the Devil.
By the 19th century the word had lost much of its force, as evinced by Robert Louis Stevenson's description of "our poor shrew of a parson".
The OED says that this sense of the word 'shrew' probably comes from the idea that the little mouse-like animals were once believed to have malignant influence on other creatures. On the other hand, the Dictionary suggests, the sense may be related to the Middle High German word schröuwel meaning 'devil'.
Another word that has changed its sex over the centuries is 'harlot'. It was originally (13th century) a low fellow or a knave. A little later it also meant a male servant, and also 'good fellow'. There were rare instances of it being used to insult women in the 15th century, and also of examples where dancing girls and actresses were described as harlots over the same period, but by the 16th century the sex-change was completed with harlot now being used quite frequently to mean strumpet or prostitute. In A Winter's Tale, Shakespeare used it in the male sense ('... the harlot king is quite beyond mine arm ...').