She told me a useful story.

Literal

She [topic-は] me [to-に] useful story [object-を] did [for-me-くれた].

役に立つ ('useful, helpful') is a relative-clause modifier of 話 ('story / talk') — literally 'a story that stands as use.' This is one of the most common Japanese expressions for 'useful,' built on the noun 役 ('role, use') + 立つ ('stand'). The benefactive ~てくれた marks the storytelling as a gift — perhaps the story imparted advice, gave context, or revealed something the speaker valued.