This is a good recipe to use:

http://allrecipes.com/Recipe/Royal-Icing-I/Detail.aspx?event8=1&prop24=SR_Thumb&e11=royal%20icing&e8=Quick%20Search&event10=1&e7=Recipe&soid=sr_results_p1i3

Look through the reviews for tips too.

Otherwise, sometimes I just use icing sugar, a little milk, and a couple drops of vanilla extract. This is the recipe I've used for years for thousands of cookies and I've always gotten compliments. Adjust the measurements to suit the consistency. And always ice your cookies once they've cooled!