We investigate complex materials by performing "Virtual Experiments" starting from three-dimensional images of grain packs obtained by X-ray CT imaging . We apply this technique to granular materials by reconstructing a numerical samples of ideal spherical beads with desired (and tunable) properties. The resulting "virtual packing" has a structure that is almost identical to the experimental one. However, from such a digital duplicate we can calculate several static and dynamical properties (e.g. the force network, avalanche precursors, stress paths, stability, fragility, etc.) which are otherwise not directly accessible from experiments. Our simulation code handles three-dimensional spherical grains and it takes into account repulsive elastic normal forces, frictional tangential forces, viscous damping and gravity. The system can be both simulated within a vessel or with periodic boundary conditions.