This is already detailed in the Bitcoin documentation under "HIerarchical Deterministic Wallets"
Well, it is detailed similarly.
Generated a private/public keypair like normal. Come up with your passphrase.
SHA256(privKey + passphrase + pubkey + index)
You keep the priv/public private as well as your passphrase.