Depends on the actual description
In true 5e fashion, you have to read the description of the individual item to know how it works. In the way of general rules we do get:
Without becoming attuned to an item that requires attunement, a
creature gains only its non magical benefits, unless its description
states otherwise. (DMG 138)
but that just highlights the existence of exceptions. Also, the rules on cursed items (also on DMG 138) do not say anything about their effect working differently in this regard, you are either attuned or not.
Let's see an example for both options. The description of the Berserker Axe states:
You gain a +1 bonus to attack and damage rolls made with this magic
weapon. In addition, while you are attuned to this weapon, ... (DMG
My interpretation is that this marks it as an exception to the rule, giving you the +1 bonus without attunement. There would be no need to add the part about attunement otherwise. However, there might be some debate about how explicit should the stating of such an exception be, and I recommend reading this answer for some perspective before you make up your mind about it.
The issue is much clearer in other cases, for example of the Dwarven Thrower:
You gain a +3 bonus to attack and damage rolls made with this magic
weapon. It has the thrown property with a normal range of 20 feet and
a long range of 60 feet. When you hit with a ranged attack using
this weapon, ... (DMG 167)
There is no additional mention of attunement in the description, so the default rules for items with attuenment are in effect, making all properties tied to attunement, including the flat bonus.