The Bell Code/Character
In a Unix/Linux terminal, there is a special character that triggers the terminals bell (chime). If this character is "printed", then you'll hear a small beeping sound. Obviously, this does not work on Windows platforms (for that, one can find an answer here.)
This special character has the code 7, in C the escape sequence for it is '\a'. All you need to do is just to print it. See the example below. Also, you can read a bit more about it here.
A C Code Sample
#include <stdio.h>
int main(int argc,char *argv[])
{
printf("\a");
return 0;
}
Visual Basic
I don't use Visual Basic. But if it does not support terminals and thus the bell character, then probably you cannot do it. The reason is, that while Visual Basic has it's own sound library functions, it will run on the server and if any, the sounds would be produced there, not in your browser. :(