Three essential commands
Here are the three macros that I use for my most basic pet control (along with the short names I put on them - you should use whatever names make sense to you). I put them on one of my secondary action bars, and I bind them to keys I can easily access with my thumb. I loosely think of my four main fingers controlling my hunter, while my thumb controls my pet.
This one is for sending the pet in to attack my current target. Effectively it makes the pet /assist me against whatever I currently have targeted. This is the most important pet control command, so I like to keep it as clean as possible without mixing it up with other abilities. Some hunters, however, find that they like to add lines to this macro, such as "/cast hunter's mark." For me, I find that this just gets in the way, and prevents me from finessing certain cool moves. For now, though, it's just important to remember that you don't necessarily want your pet and your hunter to always attack the same enemy. Splitting your damage in various directions is sometimes the best way to go, even in some situations where you're on your own. But we'll come to that.
This one, as you are probably aware, assists whatever target the pet is currently attacking. If you have the "attack on assist" interface option turned on, then it will also turn on your Auto Shot ability on that target too (otherwise you can start Auto Shot by adding "/cast !Auto Shot" on the second line - the "!" prevents Auto Shot from stopping if it already happens to be on). This macro nice because often the next target in line is already on your pet's hate list. After you kill your current target, your pet will usually turn to the next one and all you have to do is assist it, rather than moving your mouse to just the exact right spot, or tab-cycling through targets till you get to the right one. This macro is also helpful for multi-target battles in a group where you'll be doing some trapping, kiting, or whatever, because it lets you just sic your pet on the main damage target and then assist it whenever you're done with other tricks.
This command calls your pet off the attack, and back to heel at your left side. This is absolutely necessary for those trigger-happy situations where you accidentally send your pet in for the attack too soon (i.e. Just a split second before you saw a patrol coming along) and need to pull it back before it starts biting off more than both of you can chew together.
Like playing three classes at once
Now for a trick you can try out while you're leveling up, in order to get used to controlling your pet and doing different things with your pet and your hunter at the same time. When you're on your own in the wild, you may find that things go pretty fast and exciting when you take on more than one enemy at once. You can get into trouble this way if you are not prepared, or you may find yourself accidentally in this situation, but with solid control of your trusty pet, you can handle it successfully.
First of all, remember that you'll have to manage your threat. Your pet is like the warrior in this situation, and your hunter is the mage and the priest combined. Your hunter is not only going to be doing damage, but healing as well, with the Mend Pet spell. If your pet doesn't do something to gain aggro on all the enemies in the battle, your healing will cause some of them to turn away on to you and totally break your groove.
The Multi-Smack: killing several enemies together
As soon as the fight begins, tab between the enemies and use your /petattack macro to make your pet get off some attacks on each one. While your pet is doing this, (or even before) you can lay a Freezing Trap at your feet (just in case), and cast Hunter's Mark on the first enemy you want to kill. Once you're confident in your threat management, you might also be able to shoot a little bit, possibly using Serpent Sting on one or several of the enemies to get some extra damage, but don't go too far in this or you'll lose control of the fight. Your growl should go off on the first target you marked, so after you've cycled through them all, come back to that first one, and start shooting away. Make sure to keep Mend Pet up from the beginning - you want to keep your pet's health as full as possible, especially at the start when it's going to be taking the most damage from multiple targets. Use the threat meter Omen to be sure that you don't go too far above your pet's threat and accidentally pull one to yourself. Then once your first target dies, your pet will automatically switch to the next one in line. Use your /assist pet macro to switch with it, cast hunter's mark again and keep firing away. You may need to cycle through the targets again if the fight lasts a long time. Also, you may find that having an owl or carrion bird helps a lot with multi-target threat, since they have the area-of-effect Screech ability, which racks up more threat and makes your pet take less damage, too.
You may find that your pet is taking too much damage, however, and your Mend Pet is unable to safely keep up with it. In that case you can use the Freezing Trap you put down at the beginning of the fight. Go ahead and leave your pet attacking one enemy, while you switch to another enemy. A couple of good damage shots should pull it off of your pet and into your trap. Be sure not to use Serpent Sting on this enemy or your trap will fail. It's a good idea to get into the habit of laying these traps down early, since it lets your traps cooldown start running down early too - by the time your enemy is frozen, you'll have a chance to set another one down before the first one breaks.
This technique of trapping the same enemy over and over, called "chain trapping," can actually get pretty complex, and it deserves it's own guide. (Brian covered the basics of it towards the end of his post on crowd control, though, so be sure to check that out for more information.) For now, this is a good time to test the limits of what you can do with your pet in different situations. What sorts of pet tricks do you like to perform?