The simplest way: Hand them a wireless keyboard and have them enter their height and weight.
A slightly harder way that requires speech recognition: Have them speak their height and weight.
I assume, though, that you want to do this with just a web cam. I don't think you can since BMI requires a weight measurement. You can't determine weight accurately from a visual of a person. Unless you're working on some radical technology to do just this, you'd need a scale that connects via USB or WiFi, and you'd need to figure out how to use the web cam to detect a person from head to foot, and how to account for distance from the monitor. I suspect that will be hard, if not impossible to do with a normal web cam. Well, I guess with some "smarts" around object recognition, you can probably do it.
The big question is: is this the better mousetrap you want to build?