What is the problem? Where are you stuck?
Try something like:
For x As Integer = 0 to buttonCount - 1
Dim newButton as Button
newButton = New Button()
With newButton
.Name = "Category" & x.ToString & "Button"
.Text = "Category " & x.ToString
AddHandler newButton.Click, AddressOf myButtonClickEvent
'You will need to position the buttons as well...
Form1.Controls.Add(newButton)
End With
Next x
And create the eventhandler to intercept your button click events:
Public Sub myButtonClickEvent(Byval Sender as Object, Byval e as System.EventArgs)
MsgBox DirectCast(sender, Button).Name & " Clicked"
End Sub
All this written off the top of my head, so you will probably need to do a few adjustments...