No sound after upgrading to Lion, despite hardware working fine
Odd though it may seem, try launching Garage Band (if you have it) and creating/saving a new project. It seems that Garage Band does some low-level tests on your audio system when it runs, and clears up weird states like you're encountering.

This doesn't answer the question of what's wrong, but hopefully will fix it anyhow.