Although some might think you odd for contemplating your virtual affairs after death, we commend you. The more planning a person does before their death the easier things are on the executors of their estate, which are usually grieving relatives and friends. You can do quite a few things to make life easier on your family and make sure your virtual life has a tidy closure like your real one.
First, make a list of all your virtual accounts. List everything from your email accounts to your social networking profiles to one-off accounts for posting on individual forums. Once you have a complete list it's time to go through the list and cross off accounts that you want to be lost to the sands of time and unknown to your family and friends. If you have a Digg account that you use for blowing off steam with snarky and inappropriate comments, you might consider just letting that one go dark upon your death. On the other hand if your Digg account is part of the social networking profile for your business you'll want to make sure that information is made available in the event of your demise.
Second, take the accounts that made it through the first round of "Would I want my kids to know about this?" and create a secure database of logins.This secure database could be a physical one, locked in a home safe or bank's safety deposit box or it could take the form of a digital keyring. If the executors of your estate are especially unskilled at computers you might consider the physical option. A keyring is much safer, however, and there are many excellent solutions.