Needed items:
Visual Basic 2008
Your hands
Okay start a new windows application,name it to anything you want.
If you're done,do this.

Okay,now double click Button1 or you'll name it Generate.
Type in
Code:
TextBox1.Text = Int(Rnd() * 4)
Select Case TextBox1.Text
Case 0
TextBox1.Text = "CD key"
Case 1
TextBox1.Text = "CD key"
Case 2
TextBox1.Text = "CD key"
Case 3
TextBox1.Text = "CD key"
End Select
As shown below,

Type in anything you want,ANYTHING,like supposely a keygen for AVG 9.0?
Coz I made one of those,screenie of it :P

FORGOTTEN,you need to Debug>Build>And forgot what it is -_-
If you want to decorate it,go on, LOL.
(:
Sorry if it was a bad guide to you,:/