Same problem. No visual voicemail and couldn't remember original password pin. This worked for me no problem - I was actually shocked at how easily/insecufre it was. This was after I upgraded my 3GS to OS4. I don't remember the exact keys to press or sequence since it's now different that it works, but it's along these lines:
1. From phone keypad, hold 1 key to get voicemail menu
2. Choose Administrative options (or similar, maybe Pesonal first, etc.).
3. Choose to turn password off. Accept the warning. You are not asked for a password/pin.
4. Power phone off/back on
5. Phone keypad again, hold 1 to get voicemail menu
6. Choose Administrative options
7. Choose Password
8. You are prompted to enter a new password/pin. You are not prompted for any previous pin.
9. Make sure you have password turned back on after (see 3 above).
10. Exit the menus.
Within seconds, my voicemail was working without prompting for password/ping and all my visual voicemails returned fully functioning. All is good now!!