Preheat oven to 180°C (Gas mark 4/350°F). Line a 12 hole muffin tin with 12 muffin cases.
Place the butter into a mixing bowl and whisk together with the caster sugar until light and fluffy. Break the eggs into a bowl and lightly whisk with a fork. Add the eggs a little at a time to the butter and sugar mix, whisking in between.
Sift the flour on top, and using an electric whisk on a low speed, gently blend the ingredients together. Add the milk and vanilla extract and blend again. Increase the mixer speed and whisk for a few more seconds until well mixed.
Divide the cake mixture between two bowls. Colour one mixture blue and one red.
Divide the blue cake mixture between the 12 cupcake cases then add the red cake mixture on top. (if wanted, you can switch half of the cakes so that the red mixture is on the bottom and the blue on top). Smooth over the tops with the back of a spoon. Bake for 20-25 minutes until risen and springy to the touch.
Once the cakes are cooked, transfer to a wire rack to cool.
Whilst the cakes are cooling, make the buttercream icing:
Whisk the butter with an electric whisk until light and fluffy. Sift in the icing sugar, a little at a time, until completely combined. Add the vanilla extract and whisk again.
Add the milk in small splashes until the icing is at the correct consistency for piping.
Spoon the buttercream into a piping bag with a star nozzle.
Pipe a swirl of buttercream icing on each cake then scatter red, white and blue sprinkles on top.
Finish your cupcakes with paper flags if wanted, for an extra patriotic touch!