The association between obesity and attention-deficit hyperactivity disorder (ADHD) has been extensively reported in the literature. However, the potential mechanisms underlying this association are not completely understood. This study aimed to evaluate the association between body composition and ADHD and explore the possible genetic mechanisms involved. We used data from the 1982 Pelotas (Brazil) Birth Cohort at age 30-year follow-up (N = 3630). We first used logistic regression analysis to test whether body mass index (BMI), fat mass (FM), and fat-free mass (FFM) were associated with ADHD. We further tested the association between BMI polygenic risk score (BMI-PRS) and ADHD and the role of the genes upregulated in the reward system using a gene-set association approach. BMI (odds ratio [OR] = 1.05; 95% confidence interval [CI], 1.00–1.09; p = 0.038) and FM (OR = 1.04; 95% CI, 1.00–1.07; p = 0.043) were associated with ADHD. The BMI-PRS was associated with ADHD (using p-value threshold (PT) = 0.4; OR = 1.65; 95% CI, 1.02–2.65) at a nominal level. In gene-set analysis, the reward system genes were associated with BMI in subjects with a high BMI-PRS score, considering PT = 0.4 (p = 0.014). The results suggest that BMI genetic components, especially those genes related to the reward system, may be involved in this association.