We present a dynamic general equilibrium model with heterogeneous firms. Owners of firms delegate investment decisions to managers, whose consumption and investment decisions are private information. We solve the optimal contracts and characterize the implied general equilibrium. Our calibrated model has implications on the cross-sectional distribution and time-series dynamics of firms' investment, managers' compensation, and dividend payout policies. Risk sharing requires that managers' equity shares decrease with firm sizes. That, in turn, implies it is harder to prevent private benefit in larger firms, where managers have a lower equity stake under the optimal contract. Consequently, small firms invest more, pay less dividends, and grow faster than large firms. Despite the heterogeneity in firms' decision rules and the failure of Gibrat's law, we show that the size distribution of firms in our model resembles a power law distribution with a slope coefficient about 1.06, as in the data.