You need some cupcakes, icing, a piping bag, a piping tip, and a spatula or spoon. The piping tip most commonly used for cupcake swirls (though you can also use a large round tip or different star tips) is the Wilton 1M, or its equivalent. It's a large piping tip, so doesn't work with a normal coupler (that's a little plastic gadget which allows you to switch piping tips with the bag full of icing).
The icing you use is up to you, but it must be reasonably firm - not too firm to squeeze through a piping tip (you'll know it if you try to use it!) but firm enough to hold its shape once it's been squeezed out. I used cream cheese icing, which can be tricky to get firm enough (room temperature butter is the key - and never spreadable cream cheese!); other good options are whipped chocolate ganache, and meringue buttercreams. It is important the icing is smooth - lumps will prevent the icing flowing smoothly (or at all, if they're big enough!).
Twist the top of the bag to hold the icing in and hold it as shown above. I'm a lefty so you may want to hold the bag in your other hand if you're not - but whatever feels right to you is fine (some piping tips come in left- and right-handed versions, for certain flower petals and things that are piped in one direction - but mostly it's not an issue - I don't have any special left-handed equipment!).
You can use your other hand to steady the bag. For cupcake swirls I usually don't, but I used to - and I still do if I'm piping fiddly things.
Before you start piping onto the cupcake squeeze a little icing back into the bowl, to check the consistency of the icing (it should hold its shape) and get rid of extra air.
Once you've completed a loop around the outside move the piping tip in a little and lift it slightly to create the next loop. On a normal cupcake, with the 1M tip, I get about two full loops - but if you're using a smaller tip you'll go round more times, and on a mini cupcake you'll barely get one. Consistency of icing and your particular squeezing peculiarities will affect this too - doing is the best form of learning in this instance!
To finish off the swirl bring the tip into the centre, lift it very slightly, then stop squeezing completely and lift the piping bag away altogether. Stopping the pressure on the bag is the most important part (and I think the hardest bit to teach yourself to do) - but really this is a pretty low-effort activity. It takes a few tries to get the hang of it but soon you'll be churning out the fancy cupcakes!
Voila! Cupcake! Please excuse the packet of chips in the background. ;-)
I've done so many of these I could probably do them in my sleep - actually, it was quite a challenge trying to do it slowly so Mr Cake could snap the photos above. Isn't it funny how you get to the automation stage of doing things where thinking about the task throws you off completely? Have you experienced the it's-easy-if-you-don't-think-about-it thing?