Bachchu had gone to meet friends at a pharmacy shop near his home before iftar, when the five attackers on two motorcycles came into the area. They blasted a crude bomb outside the pharmacy, creating panic, the Dhaka Tribune reported.
They then dragged Shahzahan out of the shop and shot him, a senior superintendent of police was quoted as saying by the daily.
Although no group has claimed responsibility, police officials from the counter-terrorism department are investigating the murder as a possible targeted attack by Islamist extremists.
Bachchu had previously received threats from extremist groups due to his outspoken support for secularism
Bachchu was a former district general secretary of the Communist Party of Bangladesh and was known as a free-thinking writer,. His publishing house Bishaka is based in Dhaka's Banglabazar area.
Deaths of secular writers, bloggers, online activists and a publisher in attacks by suspected Islamist militants shook Bangladesh for months after the murder of atheist writer and blogger Avijit Roy in Dhaka on February 26, 2015.
Avijit's publisher Faisal Arefin Dipan was also hacked to death on October 31 the same year.
Militant groups claimed responsibility for most of these attacks and the law enforcers arrested many radical Islamists in connection with the attacks.