With Geth running, (I used geth --rinkeby --fast --cache=512 console --shh --rpc --rpccorsdomain '*' --ws --wsorigins '*'
), and web3.js v1 in the browser, type into the browser console:
> web3.shh.setProvider("ws://localhost:8546") // must use websockets (read this on https://ethereum.stackexchange.com/a/34840/6014)
> web3.shh.newKeyPair().then(console.log) // logs key pair
> web3.shh.subscribe("messages", {privateKeyID: keyPair}, (err, msg) => console.log("msg received!", msg)) // returns subscription that will log the message when it's received
> web3.shh.getPublicKey(keyPair).then(console.log) // logs public key
> web3.shh.post({pubKey: publicKey, ttl: 10, payload: '0xffffffdddddd1122', powTime: 3, powTarget: 0.5}) // sends the message