There's rarely one answer to the question "where/how did this phrase originate." Shane offers a plausible answer and he may well be right. Here's a little more information about the phrase anyway.
"Vim and vigor" is a common, more polite way of phrasing a similar idea. "Vim and vigor" implies youthful energy and, to a degree, innocence (or good intent). "Piss and vinegar" implies devilish or mischievous behaviour and general vitality. The two phrases are very similar in meaning, but they imply different things, so they shouldn't be used interchangeably.
"Piss and vinegar" may be a corruption of "vim and vigor" (they have similar sounds - when I was young, I though "vinegar" and "vigor" were the same thing!) Both phrases have been around for a long time - I know Steinbeck used "piss and vinegar" in
Grapes of Wrath, but the phrase was probably in colloquial use well before Steinbeck wrote his novel.
As a final note, "piss and vinegar" is considered vulgar, so is rarely used in "polite" conversation. It's a lot of fun to use it, though - it's a satisfying way to express frustration with someone's antics.