A US visa application can be refused for a variety of reasons, but simply having violated US immigration law does not guarantee a denial. Certain particularly severe violations trigger mandatory bars: for example, accruing more than 180 days of unlawful presence in the US during a single trip, being deported from the US, or committing misrepresentation in order to obtain an immigration benefit or employment in the United States. The grounds for these mandatory bars are enumerated in federal law.
Most US visa refusals are not based on mandatory bars. The most common type of refusal is 214(b). This is a "catch-all" and happens when the consular officer, using their discretion, believes that a nonimmigrant visa applicant is likely to use the visa for something other than its legal purpose.
Certain past immigration violations do not trigger a mandatory bar, but result in an almost certain 214(b) refusal, at least in the next several years. For example, this will generally be the case if a traveller overstayed their admission for, say, 3 months. A mandatory bar only kicks in at the 180 day mark, but overstaying for 3 months without having a very good reason would still make you look really bad; in such a situation, it would be extremely difficult to convince the consular officer that you won't do such things in the future.
So that brings us to your case. Your previous entry to the United States was not in compliance with law, but it was a "procedurally regular"  admission (or at least, you've given me no reason to think otherwise). That alone implies that you were not "unlawfully present" in the United States. It also appears that you did not commit any misrepresentation. Therefore, while you technically broke the law, there are no mandatory bars that are applicable to your situation. A consular officer will consider whether to grant your visa based on their discretion. The mistake that you made was innocent; it has little risk of being repeated by you, and it would not lead a reasonable person to believe that you will commit more serious violations such as overstaying or working illegally. Therefore, it is unlikely that you will be refused a visa based on this alone.
 For more information on the doctrine of procedural regularity, see http://myattorneyusa.com/when-entry-of-an-inadmissible-person-qualifies-as-admission