The first one is super simple and used to break cast and help you GTFO. For whichever class you play simply change the spell in the last line to your classes gtfo move of choice, and make sure you capitalize each word (IE: Displacer Beast, not displacer beast)
The next couple of macros I put together are pretty hunter specific, but warlocks and DK's could use them as syntax examples and simply edit accordingly for you to use your pet's abilities.
The first is indispensable as a hunter. On pulls (especially AOE) you should always be casting MD to the tank, and if you are questing and decide to do an AOE pull of some kind you can direct all that hate to whichever pet ya have rolling. When ya get in group simply set the tank as your focus and hit the button! When not in a group, just hit the button and it will MD to your pet.
/cast [@focus,exists][@pet,exists] Misdirection
Bonus tip: if you are on a fight where the Tanks are swapping between boss tanking and add tanking you can make a macro to swap your focus between tanks. Unfortunately I haven't figured out the syntax yet to make it a one button macro so you will need to make a macro for each of the tanks. So I have a button for Ramtosh:
and then another one for Boktosh
(once again a reminder that captialization is extremely important on names of players as well as spells)
The next macro is designed to be a one button push for BM hunters to do what they may be called upon to do in a raid or dungeon. If your corehound is out it will lust, if your quillen is out it will rez your target, and lastly if you have a pet out other than your quilen or core hound it will dismiss your pet, you re-push the same button and it will call your quillen and then you can press it a third time to rez your target. All you need to do is change the number in the macro to correspond with your quillen's order in your call pet choices. when you click on call pet the first one besides the icon is one, and the last one is 5.
/use [@pet,dead]Heart of the Phoenix(Ferocity Ability);[pet:quilen]Eternal Guardian(Exotic Ability);[pet:core hound]Ancient Hysteria(Exotic Ability);[nopet]Call Pet 4;Dismiss Pet
Hope these are useful for you! if you have any useful macros for your class or in general share them so we can all get better!