Diabetes mellitus (DM) and heart failure frequently coexist, presenting significant public health challenges. QiShenYiQi Dropping Pills (QSDP) are widely employed in the treatment of diabetes mellitus concomitant with heart failure (DM-HF). Nevertheless, the precise mechanisms underlying their efficacy have yet to be elucidated. Active ingredients and likely targets of QSDP were retrieved from the TCMSP and UniProt databases. Genes associated with DM-HF were pinpointed through searches in the GeneCards, OMIM, DisGeNET, and TTD databases. Differential genes connected to DM-HF were sourced from the GEO database. Enrichment analyses via gene ontology and Kyoto Encyclopedia of Genes and Genomes pathways, as well as immune infiltration assessments, were conducted using R software. Further analysis involved employing molecular docking strategies to explore the interactions between the identified targets and active substances in QSDP that are pertinent to DM-HF treatment. This investigation effectively discerned 108 active compounds and 257 targets relevant to QSDP. A protein–protein interaction network was constructed, highlighting 6 central targets for DM-HF treatment via QSDP. Gene ontology enrichment analysis predominantly linked these targets with responses to hypoxia, metabolism of reactive oxygen species, and cytokine receptor interactions. Analysis of Kyoto Encyclopedia of Genes and Genomes pathways demonstrated that these targets mainly participate in pathways linked to diabetic complications, such as AGE-RAGE signaling, dyslipidemia, arteriosclerosis, the HIF-1 signaling pathway, and the tumor necrosis factor signaling pathway. Further, immune infiltration analysis implied that QSDP’s mechanism in treating DM-HF might involve immune-mediated inflammation and crucial signaling pathways. Additionally, molecular docking studies showed that the active substances in QSDP have strong binding affinities with these identified targets. This research presents a new model for addressing DM-HF through the use of QSDP, providing novel insights into incorporating traditional Chinese medicine (TCM) principles in the clinical treatment of DM-HF. The implications of these findings are substantial for both clinical application and further scientific inquiry.