We consider a general tractable model for default contagion and systemic risk in a heterogeneous financial network, subject to an exogenous macroeconomic shock. We show that, under some regularity assumptions, the default cascade model could be transferred to a death process problem represented by balls-and-bins model. We also reduce the dimension of the problem by classifying banks according to different types, in an appropriate type space. These types may be calibrated to real-world data by using machine learning techniques. We then state various limit theorems regarding the final size of default cascade over different types. In particular, under suitable assumptions on the degree and threshold distributions, we show that the final size of default cascade has asymptotically Gaussian fluctuations. We next state limit theorems for different system-wide wealth aggregation functions and show how the systemic risk measure, in a given stress test scenario, could be related to the structure and heterogeneity of financial networks. We finally show how these results could be used by a social planner to optimally target interventions during a financial crisis, with a budget constraint and under partial information of the financial network.