In this work, we develop a theory for predicting details of the local structure in nonuniform multicomponent fluids that may contain chainlike and associating components. This theory is an extension�to the fluid interfaces and mesoscopic structures of different geometry�of the multilayer quasichemical model originally proposed by Smirnova to describe liquid solution in the vicinity of a planar solid wall. The basis of the theory is the "cut-and-bond" approach, much in spirit of SAFT, where an infinite attraction between the separated monomeric units of a chainlike molecule mimics the chemical bonds of the chain. We describe the equilibrium structure of the mixture, including the spatial distribution of the monomeric units and the local orientation of the chemical bonds in chainlike molecules, and discuss the contribution of chemical bonds to the local chemical potential in a nonuniform fluid. To test the new theory, we apply it to mixtures containing combinations of model components: a strongly associating solvent, an inert substance of varying chain length, and a chainlike amphiphile. To compare predictions from the multilayer model with the results of continuous description of nonuniform fluids, we also address the square-gradient theory and derive an analytical expression for the influence parameter that takes into account pair correlations in the quasichemical approximation. The multilayer quasichemical model developed in this work predicts formation of aggregates in liquid solution and describes the local structure of the interfaces between the coexisting liquid phases in the mixture. Our theoretical predictions agree on a qualitative level with the accumulated knowledge about the structure of different types of systems studied in this work.