You can do this pretty easily with CSS. Your "active" top-level nav item will have a class of either "active" or "trail", so you can set up your selector to hide children of it, i.e.
Code:
/* By Default hide all children nav items of a parent */
#myMainNav li ul
{
display: none;
}
/* But for the active item, show them */
#myMainNav li.active ul,
#myMainNav li.trail ul
{
display: block;
}
If you want to physically remove them from the HTML, one thing you can do is customize the nav_default.tpl template. You could wrap the line that says "<?php echo $item['subitems']; ?>" in a PHP IF statement -- maybe check if $item['class'] contains 'active' or 'trail'.