There are two ways to do this.
1 is with Corp. codes, which can be found in the individual threads Jack12 opened. They can take an enormous time to find the best, and while some guarantee upgrades theres no real way to know (the list is completely mixed up). There is a potential issue with renting using corp codes of companies you don't work for - you might not be insured. Personally I doubt that's true, but keep it in mind. There is really no 1 best corp. code.... some are good for airports, some for underage, one-ways, additional drivers, guaranteed upgrades. etc. Which is why it's nearly impossible to find the best. Also some are easier to pull off than others - you can easily be a Citi employee on leisure travel, but less likely to be on Military duty.
2. With regular public corporate codes (amex, delta, etc.). Then rely on status to get an upgrade. The rule of thumb is not to rent at an airport location (fees and taxes). If you have Amex Platinum, the best complimentary status you can get is from National, which gives you a free choice from its 'executive aisle'. Then your upgrade just depends on availability.
An upgrade is a highly negotiable thing - the guy can give it to you for free if he wants.
Another tip is to make reservations at multiple agencies and pick the one with the best available car (car reservations don't require a cc).