My MM bind set uses the keypad to target each minion and throw a buff or the like on it. That means the selection is hard-coded, but with a little practice using 1-9 for selected buffs and 0 for "all," with Shift-Alt-Ctrl to select which buff or power to apply, becomes almost automatic. I believe I used the numbers in the Pet list for that system. I can post some code if you like, but others have done this, too.
As for selecting a minion and throwing a buff, it would be the same, I think. Look through the /pet... commands and combine the select (by name or class) with the buff cast, in reverse order: [macroname] [buff] [select].
Not my strongest area, but the guide has a good basic section on Pets and all the commands listed.