Two Things You Might Be Mixing Up
James Whitcomb Riley and Little Orphan Annie are not the same thing, and they never were. Trying to connect them usually means you saw a reference somewhere that mashed them together by mistake, or you encountered some strange derivative work that used both names. I ran into this once when someone linked me a PDF of what they called "Riley's Little Orphan Annie" — it was just a public domain compilation of Riley's poems with a random cover image of the comic strip character slapped on it. Nothing more. Riley (1849–1916) was an Indiana poet who wrote in regional dialect. His most famous piece is "Little Orphant Annie," published in 1885 in his collection When the Frost Is on the Punkin. It's a long narrative poem about a orphan girl who tells children that "the Gobble-uns will git 'em" if they don't behave. That poem is what people sometimes mistakenly reference when they say "Little Orphan Annie." The title is similar but it is not the same thing as the comic strip character created by Harold Gray in 1924. The Riley poem and the Gray comic strip share a name that sounds almost identical, which trips people up constantly. Riley's "Little Orphant Annie" uses archaic spelling — "Orphant" with one r — while Gray's strip is "Orphan" with two. The poem is dark folklore-tinged verse; the strip is a rags-to-riches serial about a blonde girl with a secret fortune. Completely different eras, mediums, and intentions.
I spent about forty-five minutes once tracking down what someone was looking for when they googled "James Whitcomb Riley Little Orphan Annie," and the whole time I was convinced they wanted something that didn't exist. Eventually they clarified they just wanted the poem text. I sent them the Project Gutenberg link and we moved on.
Getting the Actual Poem
The Riley poem is in the public domain. You can read it at Project Gutenberg under Riley's collected works. It's also available on Poetry Foundation with some commentary. The full text runs about 170 lines and follows a consistent ballad meter in a Hoosier dialect that is genuinely harder to read aloud than it looks on the page — the dialect spelling forces you to slow down in places that the rhythm doesn't naturally indicate. If you're looking to quote it or use it in something, just be accurate with the original spelling. Modernizing it to "Little Orphan Annie" changes the feel of the poem entirely, and anyone familiar with the work will notice. I've seen too many school handouts sanitize the dialect and then wonder why students find it inaccessible.
Get the Full Details

The Comic Strip Side of Things
Harold Gray's Little Orphan Annie ran from 1924 to 1979, had radio and TV adaptations, and spawned a musical that opened on Broadway in 1977. If that's what you're actually looking for, there's a separate world of licensing, script archives, and fan material. The Annie Enterprises library holds the strip archives. The musical score is published by Music Theatre International for amateur staging. The two things only intersect in pop culture references where someone conflates them, or in very niche academic discussions about how orphan imagery functioned differently in late-19th-century children's verse versus 20th-century serialization. That's about as far as the connection goes.