“Be fearful when others are greedy and greedy when others are fearful” – Warren Buffett.

Contrarian investing involves buying out-of-favour companies and holding them until their prospects improve. It’s a brave approach that requires going against the herd, but there’s no doubt the strategy can generate sizeable returns when it’s successful. Here are three companies that are fit the bill right now and may have long-term turnaround potential.

Oil price volatility

It’s been an uncertain two years for Royal Dutch Shell (LSE: RDSB) investors.

With the oil price dropping dramatically from around $105 per barrel in 2014 to just $30 earlier this year, Shell’s share price has suffered considerably and there’s been much talk of whether the company can continue to pay out its dividend.

Indeed, Shell’s current dividend yield sits at a high 7.4%, suggesting the market believes a cut is imminent.

However with the oil price having bounced back to $50, sentiment towards the oil majors is already improving and Shell’s share price has rallied 40% since its January low. Does Shell have further to run?

While the bad news is that earnings for FY2016 are forecast to fall around 19% year-on-year, the good news is most analysts have faith that Shell’s dividend is safe for now.

None of us can be certain whether the oil price will rise or fall in the short term, but for long-term investors prepared to ride out the volatility I believe now could be a good time to take a look at Shell.

Commodity crash

BHP Billiton (LSE: BLT) has endured a roller coaster 10 years. A decade ago, the mining boom was in full swing and profits were soaring. Fast forward to today and with commodity prices having fallen off a cliff, and BHP in strife in relation to the Samarco Dam collapse, its share price has taken a hammering.

With earnings for FY2016 forecast to fall 87% and the once-mighty dividend slashed, it’s understandable that sentiment towards the company is low right now. However, with BHP’s share price having fallen from around 2,500p in 2011 to just 830p today, could it now be worth a nibble?

It may take a while for BHP to turn things around, but I do believe the world will have a need for iron ore, copper and oil in the future.

For that reason, a contrarian position in BHP might be rewarding in the long term.

High street woes

Sentiment is also at rock bottom for high street stalwart Marks and Spencer Group (LSE: MKS). It appears investors have lost faith in the endless restructuring promises and the retailer’s share price has fallen sharply from almost 600p two years ago to around 370p today. Is there any value at the current price?

New CEO Steve Rowe recently warned shareholders that a turnaround won’t happen “overnight”, yet the company still managed to increase its full-year dividend by 3.9% and announced a special dividend of 4.6p per share that will be paid in July.

With the retailer now trading on a P/E ratio of 11.7 times next year’s earnings, and with the dividend yielding over 5%, the risk/reward payoff looks intriguing.

This could be one to buy now and stash away for the future.

An alternative strategy

Of course, contrarian investing doesn't always go to plan, and things can get worse before they get better. If you're looking for a stock that does have strong momentum at the moment, read this report, A top growth share from The Motley Fool.

The experts at the Motley Fool have identified an under-the-radar company that has seen its sales rise by a huge 80% in the last three years.

Click here for your free report.

Edward Sheldon owns shares in Royal Dutch Shell B. The Motley Fool UK has recommended Royal Dutch Shell B. We Fools don't all hold the same opinions, but we all believe that considering a diverse range of insights makes us better investors.