A general multiscale and multiphysics simulation framework for inhomogeneous viscoelastic and elastoplastic complex flows, such as nanobubble flows, blood vessel flows, or polymer composite flows, is presented for use on massive parallel computers. Our simulation methodology is based on a particle simulation of macroscopic flows where a microscopic simulator is embedded in each of the hydrodynamic particles of macroscopic flow simulations to evaluate the local stress as a function of its flow history from the microscopic point of view. We developed a platform named MSSP (MultiScale Simulation Platform for complex flows) by combining the smoothed particle hydrodynamics (SPH) method and the microscopic molecular simulators. In such a technique, the main difficulty is the large amount of computation cost due to a large number of microscopic particles (typically of the order of 109 - 1010, and the inhomogeneity of the flow. To solve this problem, we propose a dynamical switching of the microscopic models between realistic particle simulations and linearized constitutive relations. An appropriate boundary condition for moving boundaries is also introduced in the SPH simulations that enables us to simulate complex flows with deformable objects such as phase-separated domains or biomembranes. A benchmark test of MSSP has been done by simulating nonlinear and non-Markovian fluids passing by an obstacle, giving good quantitative agreement with experiments in the same situation.