This is a very comun problem on these cars. I have a 98' Jetta and have the same problem.
The foam its coming from the flaps that open or close when you select them from the air vent.
It is use to seal the vent so no air will come out when you close it and also works like some kind of filter.
I dont think its really a problem unless the foam goes somewhere else thru the air intake.
I suggest to just set your fan speed on max and let the foam come out before goes inside.
The only problem will be that your vents wont be 100% close when you select the close position or that could obstruct some air coming out.
Dont think its a big deal in my opinion, unless someone else suggest otherwise.