Until a better solution is found, there are twothree work-arounds:
The correct way to do this now is with a language hint above the code sample, like so:
<!-- language: lang-vb -->
Public Sub VisualBasicCodeHere()
'This will be highlighted correctly when used in a real post
End Sub
Before the language hints were available, you had to use one of the following work-arounds:
Put two apostrophes followed by a hash (#) at the front of the comment. This works just like the // method below, but it saves one character and the result look less like a bastardized attempt at C#.
''# You're commenting!
Dim c As New Comment()
Put an extra apostrophe at the end, plus add more if needed to account for appostrophes in the comment text itself. It's nice because the comment stands out consistently, but not as nice because the comment is still colored like a string literal and you need to watch for the extra apostrophes.
'You''re commenting!'
Dim c As New Comment()
Put two apostrophes followed by two forward slashes at the front of the comment. It's nice because you don't have to worry about extra apostrophes in the comment and because the comment is colored correctly, but bad because it adds a bunch of extra junk to the front that's harder to clean out.
''// You're commenting!
Dim c As New Comment()
A lot of old, and even some new, posts still have these tricks to try to get the highlighting right, so it's worth keeping the list around, but anything new you see and any time you edit, the language hint is the way to go.