By means of numerical simulations, we investigate the behavior of granular materials immersed in a fluid. Numerical developments were carried out to interface the Lattice Boltzmann Method for fluid dynamics with the Contact Dynamics method in 2D and with the Molecular Dynamics method in 3D for the simulation of the grains. Extensive simulations were applied to study the initiation of avalanches in a granular bed inclined at an angle above its angle of repose as a function of the initial packing fraction and slope angle in 3D. The results are in excellent quantitative agreement with the reported experimental data, and show the stabilization of the granular bed by a negative pore overpressure induced by the dilatancy of the bed and the spatiotemporal evolution of the packing fraction and shear deformation. The time evolution of these variables during the creeping phase before slope failure is scaled by a theoretical model accounting for darcian drag forces and the effect of dilatancy on the internal friction coefficient. We also analyzed the granular microstructure, which shows a gradual distortion of the contact network during creep at nearly a constant connectivity and the saturation of the anisotropy at failure. The runout of granular avalanches were investigated in 2D for two different configurations : 1) the collapse of a granular column under its own weight and 2) the runout of a granular pile as a result of kinetic energy supplied directly to the grains. We find power-law dependence of the resulting runout lengths and times with respect to the initial geometry or energy of the system. The time scales are shown to be consequence of two competing effects of the fluid on the grains : reducing relaxation times by viscous friction and lubricating the contacts between grains.