The dog bit first. The word bitch comes to us from the Old English, and the OED records the first written usage in the year 1000. Around 1400, bitch was applied to lascivious women and became another word for prostitute.
The OED tracks the meaning of maliciousness or unpleasantness thusly: recorded first in 1814 in Byron's letters with "bitch of a star" (bad fate); in 1904, in Kipling, who refers to "your bitch of a country."; and finally in 1913 in D. H. Lawrences' Sons and Lovers, where Gertrude Morel, one of one the protagonists, endures her husband sneering
Look at the children, you nasty little bitch.
The OED quotes William James using "the bitch-goddess success" in 1906 and James Joyce in Portrait of the Artist as a Young Man (1916) applying the word to a man:
Is your lazy bitch of a brother gone yet?
But I think we can be confident that the word bitch was applied as a non-sexual epithet long before the OED records that usage. From the 1811 Dictionary of the Vulgar Tongue:
BITCH.... the most offensive appellation that can be given to an
English woman, even more provoking than that of whore, as may he
gathered from the regular Billinsgate or St. Giles's answer--"I may be
a whore, but can't be a bitch."
The term son of a bitch is recorded even earlier in a song from 1676 called Darkmans Budge (a term for a thief), noted in Slang and Its Analogues Past and Present:
There stands Jack Kitch, that son of a bitch