Young tech firms are flourishing owing to a boom in demand. Now, law firms that have been with them since the beginning are reaping the rewards.