Corn straw is considered a renewable biomass energy source, and its unreasonable disposal leads to resource waste and environmental pollution. Black soldier fly (Hermetia illucens L.) larvae (BSFL) facilitate the bioconversion of various types of organic wastes. In this study, we found that 88% of BSFL survived, and 37.4% of corn straw was digested after 14 days of feeding with corn straw. Contrary to expectations, the pretreatment of corn straw with alkaline hydrogen peroxide did not promote its digestion but rather reduced the growth and survival rates of BSFL. Acinetobacter, Dysgonomonas, and unclassified Enterobacteriaceae were the abundant genera in the BSFL gut fed with corn straw. Compared with the standard diet, the relative abundances of carbohydrate metabolism genes, such as the gene abundances of β-glucosidase and α-glucosidase, were higher with corn straw as the substrate. These results suggested that the gut microbial community could regulate suitable and functional microorganisms in response to the substrates. Furthermore, four cellulase-producing strains, namely Klebsiella pneumoniae, Proteus mirabilis, Klebsiella oxytoca, and Providencia rettgeri, were isolated from the guts of corn straw BSFL. These four strains helped increase the conversion rates of corn straw, the weights of BSFL, and survival rates. In summary, we reared BSFL with corn straw and discovered the functions of gut microorganisms in adapting to the substrates. We also isolated four cellulase-producing strains from the BSFL guts and declared the benefits of BSFL digesting corn straw.