There's a Metro (subway) station adjacent to DCA. There's a bridge that goes from the main terminal to the Metro station.
From the Metro station, you can take the Metro Blue Line train to Rosslyn. Then, at Rosslyn, catch the Metrobus 5A bus heading to Dulles.
The train runs quite frequently. However, the bus only runs hourly.
To get from IAD to DCA, do the reverse: take the bus and then the train.
It's probably about $4 or $5 one-way, including the train and the bus.