It probably couldn't have happened to a more deserving corporate refugee. Former Hewlett-Packard (NYSE:HPQ) CEO Carly Fiorina was often at odds with shareholders, and now, even though she's long gone, she's still at the center of investor crosshairs.

Specifically, the Indiana Electrical Workers Pension Trust Fund and the Service Employees International Union's funds have taken HP to court. They contend that the git-goin' money (up to $42 million) she took was too much. It's certainly beyond the bounds of reason, as anyone who held HP stock during her tenure will tell you. It's also, according to those who brought the suit, a direct violation of the firm's pay policies.

According to pay rules adopted in 2003, severance compensation at HP could not exceed 2.99 times a manager's base pay plus bonus -- a rule adopted after a controversial $17 million severance package given to former HP/Compaq executive Michael Capellas, who skedaddled just months after that storied merger.

According to an examination of the lawsuit in TheNew York Times, the case will hinge on whether or not the additional $7.38 million "long-term bonus" money Fiorina got as part of her package qualifies as part of the dough subject to the 2.99 formula. That plan originally stated that fired executives wouldn't receive bonuses, but according to the suit, it was amended secretly to make sure Fiorina got the bonus.

Given the lack of success that Disney shareholders had in getting back the $140 million that went to Michael Ovitz, it would seem that this will be an uphill battle. But it's a battle that we may finally be seeing more often. As the Times article notes, the law firm in the HP case is making a specialty of executive compensation suits, including targets such as Cisco (NASDAQ:CSCO) Tyson Foods (NYSE:TSN), and AIG (NYSE:AIG).

And the issue got a lot of press recently when Warren Buffett slammed CEO pay with an amusing hypothetical look at Fred Futile of Stagnant, Inc. The most oft-repeated line was the following humdinger about the payoff for getting fired. "Indeed, he can 'earn' more in that single day, while cleaning out his desk, than an American worker earns in a lifetime of cleaning toilets." Change the gender of the pronoun, and Buffett could very well have been talking about Fiorina on the eve of her dismissal. And you don't need to be a toilet scrubber to earn less than Carly's $42 million. Most of us working behind a desk will never see that kind of scratch, either, no matter how well we succeed. (That's what happens when you're not in the right club.)

I don't know whether this lawsuit will make a whit of difference for investors, but it should at least offer a lesson. Seek out companies that are not complacent on this issue. Read Buffett's letter so you understand how the drill works. Then turn your attention to the proxy statements on file at the SEC. Avoid those companies where the fix is in. As I've noted before, companies that take the worst liberties with executive compensation often find themselves cutting corners on other matters as well. Buyer, beware.

The potential for management shenanigans and the outperformance of companies with large insider stakes is one of the main reasons Motley Fool Hidden Gems makes management a key component of the investment thesis. Find out which companies meet the Gems team's standards with afree guest pass.

Seth Jayson would be happy to screw up a computer company for one-tenth of Carly's payout. At the time of publication, he had no positions in any firm mentioned here. View his stock holdings and Fool profile here. Fool rules are here.