One of the five men said they were kept shackled in a cave with little food for much of the time and their drinking water was contaminated by worms.
The men were working for a South Korean construction company and were building a road north of Mazar-e-Sharif when they were seized in December.
They arrived in Dhaka on Sunday.
One worker was shot dead and two others were released almost immediately.
The terms of their release have not been disclosed.
Correspondents say that insurgents often target government projects such as roads because they are seen to be symbols of the central government which they reject.
"When they first took us, it was winter. And they kept us in small rooms in a house. We were only allowed out once a day, at night. All we had to eat was bread,"  Mohammad Aminul Islam told the BBC's Bengali service on arrival in Dhaka on Sunday.
"When spring came, they took us to a mountain and they dug a cave and kept us there. We were always shackled. They gave us two litres of water each a day. There were worms in the water which we filtered before drinking."
Mr Islam said the Taliban would not say exactly why they were targeted.
"The militants used to say that, as fellow Muslims, the Bangladeshis should not be working for the Americans," he said.
The Taliban also complained that the work the team was doing in building roads was making it more difficult for the insurgents to plant roadside bombs.
Bangladesh's foreign minister said the Afghan government and the South Korean company were involved in the release.
It is not clear whether a ransom was paid.
In April, Taliban insurgents released 12 Iranian and Afghan engineers kidnapped while working in a remote area of western Afghanistan.
The men were employed on a road-building project in Farah province when they were taken by gunmen.
Local tribal elders acted as mediators with Taliban to secure their release.
A group of Bangladeshis, who were held hostage by the Taliban in Afghanistan for more than seven months, have been describing their ordeal to the BBC.