I asked this question about the same airport and I got this response:
***> I’m more concerned about your return trip. I’m assuming your flight
from Vienna is actually on Austrian. Austrian uses a different
terminal at IAD than United. On arrival, you’d get on a mobile lounge
which would take you to the immigration area in the main terminal.
After immigration, you go back through TSA and then have to travel
from main terminal to United terminal on the Aerotrain. Dulles is my
home airport so I have never transferred there, but I have heard it
can be ugly. Note that there are two immigration areas at Dulles. If
your inbound flight was on United metal and you were connecting, you’d
go through immigration in the United terminal rather than the main
terminal.***
So I think if your returning flight is on United it might be easier to go through immigration.
I've been struggling with finding flights with a decent layover time. There are either 40 minutes or 8 hours. I want something in the 3 to 4 hour range but I can't seem to find anything like that.