The basic cupcake pattern is as follows, you can use different yarn types and colours to produce a heap of little cakes that are all completely different.
Cast on 40sts using dk and size 10 needles
Using 1x1 rib complete 10 rows
Change yarn (opt) and K 2 rows (the sponge of the cup cake)
Change yarn (opt) and complete 4 rows of st st (this is the cake topping)
Using same yarn k4, k2tog across row
Using same yarn p4, p2tog across row
k2 tog across row, k1
Gather up stitches and secure, turn inside out and stitch side seam, stuff body of cake really well and gather up cast on edge at bottom of cake to secure well.