Macro is basicly made up of two parts: acquiring resources and making use of them. I'm going to start describing the latter.
The first thing we must know is that spending resources will take time. The less time it takes the better for us. However, we might just as well think of it the other way round: the more time we got left to macro on, the better for us. In this game there are things that are more important than macroing, such as avoiding battles with partial armies, killing scouts heading for our hidden tech and making sure our base is well defended when our opponents harassing force arrives. If we spend less time doing these things (but still doing them, after all, they've got the highest priority) we'd be left with more time to macro on.
Reducing the time spent on these things is very much about planning ahead. Make sure you know your early-game bo and the way it branches off into middle game by heart; learn to create a proper wall (both as terran and in pvz) to avoid panic when he rushes; keep a few builders spread out in your base so that you won't have to struggle with getting one out of the mineral line when you're closing in to supply limit or is in need of a new tech building or production facility; eventually you will need to make use of that clump of an army in your natural, so spread it out in groups of twelve on beforehand so that you can hotkey it quicker should the need arise.
-----
A short interlude on speed in general.
The key speed is to always know what you're supposed to do, and knowing it by heart.
The poor player spends a lot of time thinking about this, hence he doesn't have time to actually do it. As the poor player grows better he learns how to spend his time by heart; now the problem is to actually do all these things he thought about on beforehand. However, eventually he'll manage, and then he'll start to think about more, not as necessary, though still useful, things to do. Eventually he'll learn to execute these too.
As long as he always keeps thinking about new things to do, and memorizing them by heart on beforehand, he'll learn to do them. And this is the key to improvement in the speed department.
You may memorize anything in-game related. It may be a thumb rule such as "I shall remember to not stray too far away from the terran base with my mutalisks, if I do, I have to waste alot of time bringing them back" or an entire build order or how to react to a certain zerg opening. As long as you've memorized it by heart you'll be able to execute the related actions much quicker.
Another thing to consider is this: The more time you spend watching your commands being executed the less time you'll have to give new commands. The efficient player will always be giving commands but will never be watching them being executed. It's a matter of trusting yourself with being able to give commands without missclicking and trusting the game being able to function properly.
-----
Back to the macro.
In order to minimize the time spend doing everything we want to minimize the number of places visited by our screen. In that way we don't have to waste time moving the screen around as much, nor do we have to deal with the confusion that screen movement might create.
For macro this means that we want to clump up our production facilities in as few screens as possible, ultimately that is only one. Then we also want concentrate our pylons and supply depots into as few screens as possible. Of course, a protoss will need his pylons to energize his buildings, but 20 pylons may cover a bloody large area, so some are bound to be built simply in order to create supply, and these may be clumped up.
In order the reach these areas of high activity as fast as possible we want to hotkey them. This can be done in two ways. First by assigning an ordinary hotkey to the production facility in the middle of the clump and the peon building supply facilities, and then double clicking the hotkey to reach that area.
The other possibility is to use a location hotkey; f2-f4. These are assigned with shift+f2 (or f3 or f4) and activated by f2 (or f3 or f4). When activated these will bring your screen to the area where you assigned them.
When macroing off a large clump of production facilities you start out with using your hotkey to get you screen to that area. Then you select production facility #1 with the mouse and use the keyboard to build an unit, then you select building #2 with your mouse and so on...
However, zerg functions alittle different as they're often are better of expanding with their hatcheries, hence spreading them out. Still, a hatchery may save up to 3 larva so in the end the difficulty is about the same.
When it comes to making use of your resources there're two major pitfalls. I've implied these earlier in the post but they're so important that I've got point them out again.
First of all there're supply drops. I.e when you hit your supply limit and aren't able to make any new units. To avoid this it's important to always keep an eye at the supply counter and make sure to have a supply surplus. It's better to have an unnecessary pylon, or even two, than to suffer a supply drop. The better you become at this game the smaller supply surplus you'll need in order to avoid the supply drop, but you'll always need at least a small surplus.
The second pitfall is a lack of production facilities. Yes, a new production facility will cost a few minerals but they're better spent than stacked up in your bank account. In the world of Starcraft there's no interest. A progamer might need 7 gateways to run his two base protoss play but if you're worse than him you'll probably also need more gateways than him. By spending your resource surplus on more production facilities you'll be able to create a larger army.
We can take this even further. Are your minerals in your bank account slowly rising, but are still below the cost of a production facility? Or do you know that they will rise within short because an expansion is about to finnish? In these situations you might be better off cutting production for a while in order to fit in another (or a few in some cases) production facility (facilities).
There is one exception to this. During the late-game you might be low on resources (think <300 minerals in average in every running mineral line) and have to live on your resource surplus for a while, that is not the time to add more production facilities.
However, this doesn't mean that you want to save up cash because you might need it sometime in the future. Deal with the situation when it arises, but don't prepare for it. Saving up cash for that purpose is like leaving the game after the first minute, cause you might lose it and don't want to waste time. By preparing for one bad thing you induce an even worse.
One thing that might be even harder than making use of resources is to acquire them. One ill-timed expansion attempt might lose you a game, but as might lack of a well-timed expansion attempt. Iloveoov, the macro god, was not known for his ability to manage his barracks, but for his macro related decision making. He was known for knowing when to expand, when to cut scvs, when to resume scvs and so on. In short we might say: when to grow economy, when to grow army, when to grow a little both and with which ratio.
This is an area where it's very hard to give any concrete advice. However, I'm able to produce two thumb rules. As zerg, grow army when you need it in order to survive, in all other times you grow economy. As terran or protoss, never stop making scvs/probes.
They're not flawless, as with all rules there're thousands of exceptions. But my general attitude towards exceptions is that you're best off finding them on your own, cause they're often very specific and hard to describe. Besides, you'll have a much easier time remembering your own discoveries compared to the rants of another. Though, that doesn't mean that you should go ignorant through life.