Officials said on Wednesday that the attack occurred near the town of Duekoue, 400km northwest of the commercial capital Abidjan.
Army spokesman Jules Yao Yao said 41 people were killed and 64 injured. Eleven of the dead had died from apparent gunshot wounds while the remainder were stabbed to death.
Cocoa plantations are often at the heart of disputes between locals and immigrants in the region.
Immigrants have cultivated the fertile land for decades, but locals view them as sympathisers with rebels who have controlled the northern half of Ivory Coast since a failed coup bid in September 2002.
Jaro Karim, a local leader of the immigrant community, said the killing of four immigrants near Duekoue last week could have triggered Wednesday's attack.
Despite peace deals aimed at reuniting the country, Ivory Coast remains tense and outbreaks of violence are common.