www.moonpie.com for a virtual tour of the MoonPie plant
According to Bigger Secrets by William Poundstone, the foamy, adhesive filling (similar to that of Mallomar cookies) in a MoonPie marshmallow sandwich is probably made of about 39% sugar, 24% invert syrup, 20% water, 16% corn syrup, and 2% gelatin (by weight).
Poundstone once wrote to the company, asking for a recipe (to use the filling in a cake), and got a courteous reply explaining the impossibility of making the filling at home. "Some of the ingredients used in making marshmallow involve liquid sugars such as cane sugar and/or corn sugar. Those particular ingredients would only be available to you in a 350 lb. drum or a railroad tank car."