If I remember correctly, there is a plastic sleeve or guide attached to the frame (not really a retainer). Then you screw the retainer (an unfinished metal piece with a spring loaded catch) to the guide, then the chrome plastic cover is screwed to the retainer.
You cover the guide, but I really don't know if you need to glue the foam to it. It sounds like your'e using aftermarket foam buns, but I used foam that I bought by the yard. I made it big enough to fold over the top and the sides of the backs, then I tucked it in behind the frame and attached it with a few hog rings to keep it in place while I pulled the cover on. Just do what you need to do to keep it from moving around while covering it.
My foam was about 1/4" thick, and allowed me to screw the retainer and cover to it, without having to trim the foam. I'll see if I can find the pix I took, it might help to explain a bit better.
BTW, if you have the same type of retainer as I do (goes on the outside of the vinyl), it's a good idea to file the bottom edges a bit to keep them from cutting into the vinyl when you tighten the screws. Mine were pretty rough and had a sharp edge at the bottom, so I used a Dremel tool to break the edge.