There is limited information on the effect of black beans (BB) as a source of protein and resistant starch on the intestinal microbiota. The purpose of the present work was to study the effect of cooked black beans with and without high fat and sugar (HF + S) in the diet on body composition, energy expenditure, gut microbiota, short-chain fatty acids, NF-κB, occluding and insulin signaling in a rat model and the area under the curve for glucose, insulin and incretins in healthy subjects. The consumption of BB reduced the percentage of body fat, the area under the curve of glucose, serum leptin, LPS, glucose and insulin concentrations and increased energy expenditure even in the presence of HF + S. These results could be mediated in part by modification of the gut microbiota, by increasing a cluster of bacteria in the Clostridia class, mainly R. bromii, C. eutactus, R. callidus, R. flavefaciens and B. pullicaecorum and by an increase in the concentration of fecal butyrate. In conclusion, the consumption of BB can be recommended to prevent insulin resistance and metabolic endotoxemia by modifying the gut microbiota. Finally, the groups fed BB showed lower abundance of hepatic FMO-3, even with a high-fat diet protecting against the production of TMAO and obesity.