The first thing you (or anyone for that matter) ought to do when deciding on a fly rod is start with the AFTMA line weight that will cast the flies you are expecting to fish. Then pick a rod that is rated to cast that line.
That said, since you mentioned fishing for trout and bass (largemouth I assume that will run up to 5#'s or so), it makes picking just one rod a little tricky because the bushy and rather air resistent bass bugs are difficult to cast on lighter line rods typically used for trout.
Now that I said that, don't dispair because you can get one rod that will work for both, just keep in mind that it won't be the best for either. A 5 wt doesn't really have the backbone to cast bass bugs very well. Before I get beat up by experienced fly fishers, I have to say it is possible for a good caster to cast bass bugs with a 5 wt, but since you are not an expert, experienced caster, avoid the 5 wt. A 6 wt has enough backbone to cast bass bugs up to about #6 in size, which will work very well on most northern largemouths, while being an excellent rod for all sizes or trout flies. A 7 wt would be very good for tossing the bass bugs, but a bit on the heavy side for most trout flies.
Therefore, I'd recommend a 9'-10' long rod rated for a 6 wt line as the best choice if you are going to spend most of your time chasing trout, which your post appears to imply. A 9'-10' rod will allow you to keep more line off the water and help greatly when fishing lakes, and it is not too long for streams (unless you are planning to fish small, mountain streams that are lined in brush).