Preheat oven to 350°F (175°C). Line baking sheets with parchment paper.
In a large bowl, beat softened butter with brown sugar and granulated sugar until light and fluffy.
Add eggs and vanilla extract, mixing until smooth.
In a separate bowl, whisk together flour, baking soda, cinnamon, nutmeg, and salt.
Gradually combine dry ingredients with wet mixture.
Stir in oats, grated carrots, nuts, and raisins (if using).
Scoop 2-tablespoon portions of dough onto prepared baking sheets, spacing apart.
Bake for 11-12 minutes. Cookies will look slightly soft in the center.
Let cookies cool completely on the baking sheet.
For frosting: Beat butter and cream cheese until creamy. Gradually add powdered sugar, then vanilla and cornstarch.
Once cookies are cool, spread or pipe frosting on top. Decorate with sprinkles if desired.