This paper introduces heterogeneous microeconomic behavior into a demand-driven macroeconomic model in order to study the joint dynamics of leverage and capital accumulation. By identifying the links between firm level variables and aggregate quantities, the paper contributes toward a reformulation of the Minskyan formal analysis that explicitly considers the role of microeconomic factors in generating macroeconomic instability. The aggregation of heterogeneous agents is not only performed numerically, as in traditional agent-based models, but also by means of an innovative analytical methodology, originally developed in statistical mechanics and recently imported into macroeconomics. The distinctive feature is in that the joint analysis of the numerical and analytical solutions of the model sheds light on the effects of financial fragility at the firm level on the dynamics of the macroeconomy. In particular, the analysis of steady-state and stability properties of the system provide additional insights on the role of behavioral and size heterogeneity of firms for the stocks of aggregate debt and capital.