I don't know how this is done out of the box and I honestly doubt that Apple built that into the SDK.
Anyway, you could create a custom view with a button on it, add the background of the badge as a UIImageView and place a label on it to hold the badge count.
That's a quick solution, it might be better to create a custom subclass of UIButton
and add your badge stuff as a subview