A membranous or muscular structure in mollusks that surrounds the visceral mass and secretes a shell if one is present.