  We determine the structure of certain moduli spaces of ideal sheaves by
generalizing an earlier result of the first author. As applications, we compute
the (virtual) Hodge polynomials of these moduli space, and calculate the
Donaldson-Thomas invariants of certain 3-folds with trivial canonical classes.
